<?php

/**
 * Recepient form base class.
 *
 * @package    form
 * @subpackage recepient
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseRecepientForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'picture'       => new sfWidgetFormTextarea(),
      'firstname'     => new sfWidgetFormInput(),
      'middleinitial' => new sfWidgetFormInput(),
      'lastname'      => new sfWidgetFormInput(),
      'age'           => new sfWidgetFormInput(),
      'status'        => new sfWidgetFormChoice(array('choices' => array('S' => 'S', 'W' => 'W', 'M' => 'M'))),
      'purok'         => new sfWidgetFormInput(),
      'barangay'      => new sfWidgetFormInput(),
      'town_id'       => new sfWidgetFormDoctrineSelect(array('model' => 'Town', 'add_empty' => false)),
      'occupation'    => new sfWidgetFormInput(),
      'income'        => new sfWidgetFormInput(),
      'contactno'     => new sfWidgetFormInput(),
      'education'     => new sfWidgetFormInput(),
      'childno'       => new sfWidgetFormInput(),
      'fchildno1'     => new sfWidgetFormInput(),
      'fchildno11'    => new sfWidgetFormInput(),
      'fchildno16'    => new sfWidgetFormInput(),
      'fchildno21'    => new sfWidgetFormInput(),
      'mchildno1'     => new sfWidgetFormInput(),
      'mchildno11'    => new sfWidgetFormInput(),
      'mchildno16'    => new sfWidgetFormInput(),
      'mchildno21'    => new sfWidgetFormInput(),
      'seminars'      => new sfWidgetFormTextarea(),
      'broiler'       => new sfWidgetFormInputCheckbox(),
      'pig'           => new sfWidgetFormInputCheckbox(),
      'goat'          => new sfWidgetFormInputCheckbox(),
      'tilapia'       => new sfWidgetFormInputCheckbox(),
      'chicken'       => new sfWidgetFormInputCheckbox(),
      'swine'         => new sfWidgetFormInputCheckbox(),
      'fruits'        => new sfWidgetFormInputCheckbox(),
      'vegetables'    => new sfWidgetFormInputCheckbox(),
      'cash'          => new sfWidgetFormInputCheckbox(),
      'land'          => new sfWidgetFormInputCheckbox(),
      'housing'       => new sfWidgetFormInputCheckbox(),
      'others'        => new sfWidgetFormTextarea(),
      'charrefs'      => new sfWidgetFormTextarea(),
      'comments'      => new sfWidgetFormTextarea(),
      'date'          => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorDoctrineChoice(array('model' => 'Recepient', 'column' => 'id', 'required' => false)),
      'picture'       => new sfValidatorString(array('required' => false)),
      'firstname'     => new sfValidatorString(array('max_length' => 50)),
      'middleinitial' => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'lastname'      => new sfValidatorString(array('max_length' => 50)),
      'age'           => new sfValidatorInteger(array('required' => false)),
      'status'        => new sfValidatorChoice(array('choices' => array('S' => 'S', 'W' => 'W', 'M' => 'M'), 'required' => false)),
      'purok'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'barangay'      => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'town_id'       => new sfValidatorDoctrineChoice(array('model' => 'Town')),
      'occupation'    => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'income'        => new sfValidatorNumber(array('required' => false)),
      'contactno'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'education'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'childno'       => new sfValidatorInteger(array('required' => false)),
      'fchildno1'     => new sfValidatorInteger(array('required' => false)),
      'fchildno11'    => new sfValidatorInteger(array('required' => false)),
      'fchildno16'    => new sfValidatorInteger(array('required' => false)),
      'fchildno21'    => new sfValidatorInteger(array('required' => false)),
      'mchildno1'     => new sfValidatorInteger(array('required' => false)),
      'mchildno11'    => new sfValidatorInteger(array('required' => false)),
      'mchildno16'    => new sfValidatorInteger(array('required' => false)),
      'mchildno21'    => new sfValidatorInteger(array('required' => false)),
      'seminars'      => new sfValidatorString(array('required' => false)),
      'broiler'       => new sfValidatorBoolean(array('required' => false)),
      'pig'           => new sfValidatorBoolean(array('required' => false)),
      'goat'          => new sfValidatorBoolean(array('required' => false)),
      'tilapia'       => new sfValidatorBoolean(array('required' => false)),
      'chicken'       => new sfValidatorBoolean(array('required' => false)),
      'swine'         => new sfValidatorBoolean(array('required' => false)),
      'fruits'        => new sfValidatorBoolean(array('required' => false)),
      'vegetables'    => new sfValidatorBoolean(array('required' => false)),
      'cash'          => new sfValidatorBoolean(array('required' => false)),
      'land'          => new sfValidatorBoolean(array('required' => false)),
      'housing'       => new sfValidatorBoolean(array('required' => false)),
      'others'        => new sfValidatorString(array('required' => false)),
      'charrefs'      => new sfValidatorString(array('required' => false)),
      'comments'      => new sfValidatorString(array('required' => false)),
      'date'          => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('recepient[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Recepient';
  }

}